package com.whq.thrift.api.common.kafka;

import java.util.LinkedList;

public class KafkaStringMsgQueue {
	private final LinkedList<KafkaStringMsg> list = new LinkedList<KafkaStringMsg>();
	public void put(KafkaStringMsg msg){
		synchronized(list){
			list.addFirst(msg);
			list.notifyAll();
		}
	}
	
	public KafkaStringMsg get(){
		synchronized(list){
			KafkaStringMsg msg = list.removeLast();
			list.notifyAll();
			return msg;
		}
	}
	
	public boolean isEmpty(){
		return list.isEmpty();
	}
	
	public int count() {
		return list.size();
	}
}
